import * as BL from 'babylon-lib/index';
import { DefaultStage } from "./stages/default-stage";
import { RawAssetsUrl } from "./raw-assets-info";
import { AppUI } from './app-ui';
import * as Data from './data/data';


export default class AppContainer extends BL.BabylonContainer {

    protected options(): BL.IContainerOptions {
        return {
            adaptToDeviceRatio: true,
            engineOptions:{
                limitDeviceRatio:1.5,
                preserveDrawingBuffer:true,
            },
            showPerformance:!Data.isProduction.value,
        };
    }
    protected loadingUI(): HTMLElement | null {
        return document.getElementById('loading-page');
    }

    protected initializeStages(engine: BL.Engine, canvas: HTMLCanvasElement, bufferLoader: BL.BufferLoad): Array<BL.Stage> {
        const stage = new DefaultStage(engine, canvas, bufferLoader);
        return [stage];
    }

    protected preloadAssetsUrl(): BL.ILoose<string> {
        return {
            lightCubePx: RawAssetsUrl.lightCubePX,
            lightCubePz: RawAssetsUrl.lightCubePZ,
        };
    }

    protected renderUI(): void {
        const appUi=new AppUI(this.engine,this.stageManager.stages);
    }

    

}